package com.linfeng.component.mybatisplus.executor.cmd;

import cn.hutool.http.server.HttpServerRequest;
import com.linfeng.component.mybatisplus.entity.IEntity;
import com.linfeng.component.mybatisplus.event.cmd.UpdateCmd;
import org.springframework.beans.factory.annotation.Autowired;

public abstract class UpdateCmdExe<C extends UpdateCmd, E extends IEntity> {

    @Autowired
    protected E entity;

    public boolean execute(C cmd) {

        handlerCmd(cmd);

        return entity.update(cmd);
    }

    public void handlerCmd(C cmd) {
        // todo
        cmd.setUpdaterId(1L);
    }
}
